﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace GIVisualEditor
{
    public partial class FirstTimeUsageGuide : Form
    {
        List<Image> helpImages = new List<Image>();
        private int currentIndex = 0;

        public FirstTimeUsageGuide()
        {
            InitializeComponent();
            this.FormClosing += new FormClosingEventHandler(FirstTimeUsageGuide_FormClosing);
            this.Load += new EventHandler(FirstTimeUsageGuide_Load);
        }

        void FirstTimeUsageGuide_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (checkBox1.Checked)
            {
                Properties.Settings.Default.IsFirstTimeUsage = false;
                Properties.Settings.Default.Save();

            }
        }

        void FirstTimeUsageGuide_Load(object sender, EventArgs e)
        {
            helpImages.Add(global::GIVisualEditor.Properties.Resources.FirstTimeHelp1);
            helpImages.Add(global::GIVisualEditor.Properties.Resources.FirstTimeHelp2);
            helpImages.Add(global::GIVisualEditor.Properties.Resources.FirstTimeHelp3);
            helpImages.Add(global::GIVisualEditor.Properties.Resources.FirstTimeHelp4_1 );
            helpImages.Add(global::GIVisualEditor.Properties.Resources.FirstTimeHelp4_2);
            helpImages.Add(global::GIVisualEditor.Properties.Resources.FirstTimeHelp4);

            currentIndex = -1;
            ShowNext();
        }

        private void ShowNext()
        {
            currentIndex++;
            if (currentIndex > (helpImages.Count-1)) currentIndex = 0;

            pictureBox1.Image = helpImages[currentIndex];
        }


        private void ShowPrevious()
        {
            currentIndex--;
            if (currentIndex < 0) currentIndex = helpImages.Count - 1;
            pictureBox1.Image = helpImages[currentIndex];
        }

        private void btnPrev1_Click(object sender, EventArgs e)
        {
            ShowPrevious();
        }

        private void btnNext1_Click(object sender, EventArgs e)
        {
            ShowNext();
        }

        private void btnPrev2_Click(object sender, EventArgs e)
        {
            ShowPrevious();
        }

        private void btnNext2_Click(object sender, EventArgs e)
        {
            ShowNext();
        }

        private void btnPrev3_Click(object sender, EventArgs e)
        {
            ShowPrevious();
        }

        private void btnNext3_Click(object sender, EventArgs e)
        {
            ShowNext();
        }
    }
}
